<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <title>闲闲二手交易网站 | 商品管理</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta content="Preview page of Metronic Admin Theme #4 for statistics, charts, recent events and reports" name="description" />
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
    <link href="/assets/metronic/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/metronic/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/metronic/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/metronic/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <link href="/assets/metronic/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/metronic/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN THEME GLOBAL STYLES -->
    <link href="/assets/metronic/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
    <link href="/assets/metronic/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
    <!-- END THEME GLOBAL STYLES -->
    <!-- BEGIN THEME LAYOUT STYLES -->
    <link href="/assets/metronic/layouts/layout4/css/layout.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/metronic/layouts/layout4/css/themes/default.min.css" rel="stylesheet" type="text/css" id="style_color" />
    <link href="/assets/metronic/layouts/layout4/css/custom.min.css" rel="stylesheet" type="text/css" />
    <!-- END THEME LAYOUT STYLES -->
    <!-- begin dropzone -->
    <link href="/assets/plugins/dropzone/dropzone.css" rel="stylesheet" type="text/css" />
    <link href="/assets/plugins/dropzone/min/basic.min.css" rel="stylesheet" type="text/css" />
    <!-- end dropzone -->
    <!-- begin wangEditor -->
    <link href="/assets/plugins/wangEditor/wangEditor.min.css" rel="stylesheet" type="text/css" />
    <!-- end wangEditor -->
    <link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->

<body class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo">
<!-- BEGIN HEADER -->
<div class="page-header navbar navbar-fixed-top">
    <!-- BEGIN HEADER INNER -->
    <div class="page-header-inner ">
        <!-- BEGIN LOGO -->
        <div class="page-logo">
            <a href="javascript:location.reload()" style="margin-top: 14px;margin-left: 10px">
                <span style="font-size: 20px;">XX-Transaction</span>
            </a>
            <div class="menu-toggler sidebar-toggler">
                <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->
            </div>
        </div>
        <!-- END LOGO -->
        <!-- BEGIN RESPONSIVE MENU TOGGLER -->
        <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a>
        <!-- END RESPONSIVE MENU TOGGLER -->
        <!-- BEGIN PAGE TOP -->
    </div>
    <!-- END HEADER INNER -->
</div>
<!-- END HEADER -->
<!-- BEGIN HEADER & CONTENT DIVIDER -->
<div class="clearfix"> </div>
<!-- END HEADER & CONTENT DIVIDER -->
<!-- BEGIN CONTAINER -->
<div class="page-container">
    <div th:replace="common/seller-menu"/>
    <!-- BEGIN CONTENT -->
    <div class="page-content-wrapper">
        <!-- BEGIN CONTENT BODY -->
        <div class="page-content">
            <!-- BEGIN PAGE HEAD-->
            <div class="page-head">
                <!-- BEGIN PAGE TITLE -->
                <div class="page-title">
                    <h1>卖家中心</h1>
                </div>
                <!-- END PAGE TITLE -->
            </div>
            <!-- END PAGE HEAD-->
            <!-- BEGIN PAGE BREADCRUMB -->
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <a href="index.html">商品管理</a>
                    <i class="fa fa-circle"></i>
                </li>
                <li>
                    <span class="active" >添加商品</span>
                </li>
            </ul>
            <!-- END PAGE BREADCRUMB -->
            <!-- BEGIN PAGE BASE CONTENT -->
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet light form-fit bordered">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-user"></i>
                                <span class="caption-subject font-dark bold uppercase">填写商品相关信息</span>
                            </div>
                        </div>
                        <div class="portlet-body form">
                            <form action="/sellerGoods/save" id="form-username" class="form-horizontal form-bordered" method="post">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">商品名称</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-user"></i>
                                                        </span>
                                            <input type="text" id="goodsName" name="goodsName" class="form-control" placeholder="请输入商品名称" required ></div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">商品分类</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-reorder"></i>
                                                        </span>
                                            <input type="text" id="categoryId" name="categoryId" class="form-control" placeholder="请输入商品分类" required ></div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">现价</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-cny"></i>
                                                        </span>
                                            <input type="number" id="price" name="price"  class="form-control" placeholder="请输入商品现价格" required> </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">原价</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-cny"></i>
                                                        </span>
                                            <input type="number" id="originalPrice" name="originalPrice"  class="form-control"  placeholder="请输入商品原价格" required> </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">数量</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-plus-square"></i>
                                                        </span>
                                            <input type="number" id="goodsNumber" name="goodsNumber"  class="form-control" placeholder="请输入上商品数量" required> </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">图片1</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                            <input type="hidden" id="picture1" name="picture1">
                                        </div>
                                        <div id="dropz" class="dropzone">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">图片2</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                            <input type="hidden" id="picture2" name="picture2">
                                        </div>
                                        <div id="dropz2" class="dropzone">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">商品详情</label>
                                    <div class="col-sm-7">
                                        <input  type="hidden" id="goodsDetail" name="goodsDetail"/>
<!--                                        <div class="input-group">-->
<!--                                                        <span class="input-group-addon">-->
<!--                                                            <i class="fa fa-sticky-note"></i>-->
<!--                                                        </span>-->
<!--                                            <input type="text" id="goodsDetail" name="goodsDetail"  class="form-control" placeholder="请输入商品的具体描述" required> </div>-->
                                        <div id="editor">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actions">
                                    <div class="row">
                                        <div class="col-md-offset-3 col-md-9">
                                            <button type="submit" class="btn green" id="save" >
                                                <i class="fa fa-check"></i>保存</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <!-- END PORTLET-->
                </div>
            </div>
            <!-- END PAGE BASE CONTENT -->
        </div>
        <!-- END CONTENT BODY -->
    </div>
    <!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="page-footer">
</div>
<!-- END FOOTER -->
<!-- BEGIN CORE PLUGINS -->
<script src="/assets/metronic/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/js.cookie.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="/assets/metronic/global/scripts/datatable.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/datatables/datatables.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js" type="text/javascript"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN THEME GLOBAL SCRIPTS -->
<script src="/assets/metronic/global/scripts/app.min.js" type="text/javascript"></script>
<!-- END THEME GLOBAL SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="/assets/metronic/pages/scripts/dashboard.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/morris/morris.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/morris/raphael-min.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME LAYOUT SCRIPTS -->
<script src="/assets/metronic/layouts/layout4/scripts/layout.min.js" type="text/javascript"></script>
<script src="/assets/metronic/layouts/layout4/scripts/demo.min.js" type="text/javascript"></script>
<script src="/assets/metronic/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
<script src="/assets/metronic/layouts/global/scripts/quick-nav.min.js" type="text/javascript"></script>
<!-- END THEME LAYOUT SCRIPTS -->
<!-- App -->
<script src="/assets/app/app.js" type="text/javascript"></script>
<script src="/assets/app/datetime.js" type="text/javascript"></script>
<!-- dropzone -->
<script src="/assets/plugins/dropzone/min/dropzone.min.js" type="text/javascript"></script>
<!-- wangEditor -->
<script src="/assets/plugins/wangEditor/wangEditor.min.js" type="text/javascript"></script>
<script>
    Dropzone.autoDiscover = false;

    var myDropzone = new Dropzone("#dropz", {
        url: "/upload", // 文件提交地址
        method: "post",  // 也可用put
        paramName: "dropzFile", // 默认为file
        maxFiles: 1,// 一次性上传的文件数量上限
        maxFilesize: 10, // 文件大小，单位：MB
        acceptedFiles: ".jpg,.gif,.png,.jpeg", // 上传的类型
        addRemoveLinks: true,
        parallelUploads: 1,// 一次上传的文件数量
        //previewsContainer:"#preview", // 上传图片的预览窗口
        dictDefaultMessage: '拖动文件至此或者点击上传',
        dictMaxFilesExceeded: "您最多只能上传1个文件！",
        dictResponseError: '文件上传失败!',
        dictInvalidFileType: "文件类型只能是*.jpg,*.gif,*.png,*.jpeg。",
        dictFallbackMessage: "浏览器不受支持",
        dictFileTooBig: "文件过大上传文件最大支持.",
        dictRemoveLinks: "删除",
        dictCancelUpload: "取消",
        init: function () {
            this.on("success", function (file, data) {
                // 上传成功触发的事件
                $("#picture1").val(data.filePath)
            });
            this.on("removedfile", function (file) {
                // 删除文件时触发的方法
                $("#picture1").val()
            });
        }
    });

    var myDropzone = new Dropzone("#dropz2", {
        url: "/upload", // 文件提交地址
        method: "post",  // 也可用put
        paramName: "dropzFile", // 默认为file
        maxFiles: 1,// 一次性上传的文件数量上限
        maxFilesize: 10, // 文件大小，单位：MB
        acceptedFiles: ".jpg,.gif,.png,.jpeg", // 上传的类型
        addRemoveLinks: true,
        parallelUploads: 1,// 一次上传的文件数量
        //previewsContainer:"#preview", // 上传图片的预览窗口
        dictDefaultMessage: '拖动文件至此或者点击上传',
        dictMaxFilesExceeded: "您最多只能上传1个文件！",
        dictResponseError: '文件上传失败!',
        dictInvalidFileType: "文件类型只能是*.jpg,*.gif,*.png,*.jpeg。",
        dictFallbackMessage: "浏览器不受支持",
        dictFileTooBig: "文件过大上传文件最大支持.",
        dictRemoveLinks: "删除",
        dictCancelUpload: "取消",
        init: function () {
            this.on("success", function (file, data) {
                // 上传成功触发的事件
                $("#picture2").val(data.filePath)
            });
            this.on("removedfile", function (file) {
                // 删除文件时触发的方法
                $("#picture2").val()
            });
        }
    });

    $(function () {
        var E = window.wangEditor;
        var editor2 = new E('#editor');
        editor2.create();

        $("#save").bind("click",function () {
            var _goodsDetail = editor2.txt.html();
             $("#goodsDetail").val(_goodsDetail);
        });
    });

</script>
</body>
</html>